package com.bosssoft.springcloud.service.impl;

import com.bosssoft.springcloud.dao.PermissionDao;
import com.bosssoft.springcloud.entity.dto.PermissionDTO;
import com.bosssoft.springcloud.service.PermissionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class PermissionServiceImpl implements PermissionService {
    @Resource
    private PermissionDao permissionDao;

    /***
     * 根据权限id查询权限信息
     * @param id 权限id
     * @return 权限信息
     */
    @Override
    public PermissionDTO findPermissionById(int id) {
        return permissionDao.findPermissionById(id);
    }

    /***
     * 增加权限
     * @param pid 权限id
     * @return
     */
    @Override
    public int addPermission(int pid) {
        return permissionDao.addPermission(pid);
    }

    /***
     * 移除权限
     * @param pid 权限id
     * @return
     */
    @Override
    public int removePermission(int pid) {
        return permissionDao.removePermission(pid);
    }
}
